<div id="header">
   <ul>
      <li><a><%= link_to "首页", :controller=>"index" %><span></span></a></li>
      <% if session[:user_id] == nil #未登录  %>
        <% form_remote_tag  :url=>{:controller=>"login", :action=>"login"} do %>
        <span class="STYLE5"><%= flash[:notice] %></span>
        <span class="STYLE5"><label for="account">用户名</label></span>
        <%= text_field_tag 'account' %>
        <span class="STYLE5"><label for="password">密码</label></span>
        <%= password_field_tag 'password' %>
        <%= submit_tag ' 登录 ' %>
        <% end %>
     <% else %>
        <form>
        <span class="STYLE5"><%= flash[:notice] %></span>
        <% user = User.find_by_id(session[:user_id])  %>
        <span class="STYLE5"><%=h user.account   %> <%= link_to "注销", :controller=>"login", :action=>"logout" %></span>
        </form>
     <% end %>
   </ul>
</div>